{capture name=path}{l s='Shipping'}{/capture}
{include file=$tpl_dir./breadcrumb.tpl}

<h2>{l s='Delivery address' mod='kreditor'}</h2>

{assign var='current_step' value='payment'}
{include file=$tpl_dir./order-steps.tpl}
{if !empty($errors)}
	<div class="error">
		<p>{$errors}</p>
	</div>
{/if}

<h3>{l s='Kreditor payment' mod='kreditor'}</h3>

<form action="{$this_path_ssl}validation.php" method="post">
<input type="hidden" name="confirm" value="1" />
<input type="hidden" name="addressflag" value="1" />
<p>
	{l s='The delivery and invoice address must match your registered home address when paying with Kreditor.' mod='kreditor'}
	<br/><br />
	{l s='Please choose the address below to be used as delivery and invoice address. The delivery and invoice address on your order will be updated with the chosen address.' mod='kreditor'}
</p>
      <TABLE>
	{counter start=1 assign=i}
	{foreach from=$addresses item=kreditor_address}
		<TR>
			<TD><input type="radio" name="adressnr" value="{$i}" {if $i==1}checked{/if}></TD>
			<TD>
			{$kreditor_address.fname}&nbsp;{$kreditor_address.lname}<br />
			{$kreditor_address.street}<br />
			{$kreditor_address.postcode}&nbsp;{$kreditor_address.city}<br />
			</TD>
		</TR>
	{counter print=false}
	{/foreach}
	</TABLE>
<p>
	<br /><br />
	<b>{l s='Please confirm your order by clicking \'I confirm my order\'' mod='kreditor'}.</b>
</p>
<p class="cart_navigation">
	<a href="{$base_dir_ssl}order.php?step=3" class="button_large">{l s='Other payment methods' mod='kreditor'}</a>
	<input type="submit" name="submit" value="{l s='I confirm my order' mod='kreditor'}" class="exclusive_large" />
</p>
	<input type="hidden" name="upload" value="1" />
	<input type="hidden" name="kreditor_fname" value="{$address->firstname}" />
	<input type="hidden" name="kreditor_lname" value="{$address->lastname}" />
	<input type="hidden" name="kreditor_street" value="{$address->address1}" />
	{if !empty($address->address2)}<input type="hidden" name="address2" value="{$address->address2}" />{/if}
	<input type="hidden" name="kreditor_city" value="{$address->city}" />
	<input type="hidden" name="kreditor_postno" value="{$address->postcode}" />
	<input type="hidden" name="country" value="{$country->iso_code}" />
	<input type="hidden" name="amount" value="{$amount}" />
	<input type="hidden" name="kreditor_email" value="{$email}" />
	<input type="hidden" name="kreditor_pnum" value="{$pno}" />
	<input type="hidden" name="kreditor_telephone" value="{$telephone}" />
{if !$discounts}
	<input type="hidden" name="shipping_1" value="{$shipping}" />
	{counter assign=i}
	{foreach from=$products item=product}
	<input type="hidden" name="item_name_{$i}" value="{$product.name}{if isset($product.attributes)} - {$product.attributes}{/if}" />
	<input type="hidden" name="amount_{$i}" value="{$product.KreditorAmount}" />
	<input type="hidden" name="quantity_{$i}" value="{$product.quantity}" />
	{counter print=false}
	{/foreach}
{else}
	<input type="hidden" name="item_name_1" value="{l s='My cart' mod='kreditor'}" />
	<input type="hidden" name="amount_1" value="{$total}" />
	<input type="hidden" name="quantity_1" value="1" />
{/if}
	<input type="hidden" name="business" value="{$business}" />
	<input type="hidden" name="receiver_email" value="{$business}" />
	<input type="hidden" name="cmd" value="_cart" />
	<input type="hidden" name="charset" value="utf-8" />
	<input type="hidden" name="currency" value="{$currency->iso_code}" />
	<input type="hidden" name="payer_id" value="{$customer->id}" />
	<input type="hidden" name="payer_email" value="{$customer->email}" />
	<input type="hidden" name="custom" value="{$id_cart}" />
	<input type="hidden" name="return" value="{$goBackUrl}" />
	<input type="hidden" name="notify_url" value="{$returnUrl}" />
    <input type="hidden" name="rm" value="1" />
	<input type="hidden" name="bn" value="PRESTASHOP_WPS" />
</form>